package com.zzp.zjs_bos.web.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.zzp.zjs_bos.domain.Function;
import com.zzp.zjs_bos.utils.BOSContext;
import com.zzp.zjs_bos.web.action.base.BaseAction;

@Controller
@Scope("prototype")
public class FunctionAction extends BaseAction<Function> {
	
	public String list(){
		List<Function> list = functionService.findAll();
		String[] excludes = new String[]{"roles","children","parentfunction","zindex"};
		this.writeList2Json(list, excludes);
		return NONE;
	}
	
	public String findMenu(){
		List<Function> list = functionService.findByUser(BOSContext.getUser());
		String[] excludes = new String[]{"children","roles","parentfunction"};
		this.writeList2Json(list, excludes);
		return NONE;
	}
}
